/**
 * Copyright (c) 2016-2019 人人开源 All rights reserved.
 * <p>
 * https://www.renren.io
 * <p>
 * 版权所有，侵权必究！
 */

package com.cn.xiaonuo.tcrfinance.tcrshops.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cn.xiaonuo.tcrfinance.tcrorder.entity.BuySellSummary;
import com.cn.xiaonuo.tcrfinance.tcrorder.entity.PvBuySellOrder;
import com.cn.xiaonuo.tcrfinance.tcrorder.entity.ReflectRecord;
import com.cn.xiaonuo.tcrfinance.tcrorder.entity.ReflectSummary;
import com.cn.xiaonuo.tcrfinance.tcrshops.entity.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * Banner
 *
 * @author Mark sunlightcs@gmail.com
 */
@Repository
@Mapper
public interface PlatformMapper extends BaseMapper<PvShop> {

    List<Map<String, Object>> queryShopList(PvShop pvShop);

    // 自营商品订单物流
    List<Map<String, Object>> selectOrderLogisticsByself(
            @Param("jk_status") String jk_status,
            @Param("deliveryStatus") Integer deliveryStatus,
            @Param("serialNumber") String serialNumber,
            @Param("startTime") String startTime,
            @Param("endTime") String endTime,
            @Param("shopId") Integer shopId,
            @Param("salesMode") Integer salesMode
    );

    //充值记录
    List<Map<String, Object>> selcetInGoldemDeatail(PlatformEntity platformEntity);

    List<Map<String, Object>> selcetInGoldemDeatail2(PlatformEntity platformEntity);


    //充值记录(统计充值总金额)
    Double selcetInGoldemDeatailTotal(PlatformEntity platformEntity);

    Double selcetInGoldemDeatailTotal2(PlatformEntity platformEntity);

    //全部交易记录
    List<Map<String, Object>> selectAllTradeDetail(PvBuySellOrder pvBuySellOrder);

    //提现记录
    List<Map<String, Object>> selcetOutGoldemDeatail(ReflectRecord reflectRecord);

    List<Map<String, Object>> selcetOutGoldemDeatail2(ReflectRecord reflectRecord);
    //汇总信息
    ReflectSummary reflectCount(ReflectRecord reflectRecord);

    ReflectSummary reflectCount2(ReflectRecord reflectRecord);
    //全平台物流订单
    List<Map<String, Object>> selectPlatformDeliveryDetail(@Param("serialNum") String serialNum, @Param("logisticsNum") String logisticsNum,
                                                           @Param("status") Integer status);

    //申请提现记录
    List<Map<String, Object>> selectRemitDetail(ReflectRecord reflectRecord);

    List<Map<String, Object>> selectRemitDetail2(ReflectRecord reflectRecord);
    //申请提现汇总
    ReflectSummary selectRemitDetailSum(ReflectRecord reflectRecord);

    ReflectSummary selectRemitDetailSum2(ReflectRecord reflectRecord);




    //买卖交易记录汇总记录
    BuySellSummary tradeSummary(PvBuySellOrder pvBuySellOrder);

    //三七分润
    List<Map<String, Object>> selecTnotoginsengDetail(TradeRequest tradeRequest);
    //三七分润汇总
    TradeSummary TradeSumy(TradeRequest tradeRequest);

    //查询释放记录
    List<Map<String,Object>>   selectReleasedDetails(@Param("accounts") String  accounts,
                                                     @Param("begin") String  begin,
                                                     @Param("end") String end,
                                                     @Param("productId") String productId,
                                                     @Param("productName") String productName,
                                                     @Param("shopId") Integer shopId

    );


    //查询释放记录(统计释放数量总和)
    Double   selectReleasedDetailsTotal(@Param("accounts") String  accounts,
                                        @Param("begin") String  begin,
                                        @Param("end") String end,
                                        @Param("productId") String productId,
                                        @Param("productName") String productName,
                                        @Param("shopId") Integer shopId
    );

    //奖励记录汇总记录
    Double rewardSumy(PlatformEntity platformEntity);

    //奖励记录
    List<Map<String, Object>> rewardPage(PlatformEntity platformEntity);

    //余额记录汇总记录
    List<Map<String, Object>> surplusPage(PlatformEntity platformEntity);

    //余额记录
    Double surplusSum(PlatformEntity platformEntity);

    //余额记录汇总记录
    List<Map<String, Object>> prizeTotalPage(PlatformEntity platformEntity);

    //余额记录
    Double prizeSum(PlatformEntity platformEntity);

    //余额记录汇总记录
    List<Map<String, Object>> giftPage(PlatformEntity platformEntity);

    //余额记录
    Double giftSum(PlatformEntity platformEntity);


    List<Map<String, Object>> selectGeneralOrderList(PvOrderRequest pvOrderRequest);

    /**
     * 微信支付合计
     * @param pvBuySellOrder
     * @return
     */
    Map<String, Object> summaryWx(PvBuySellOrder pvBuySellOrder);


    /**
     * 支付宝合计
     * @param pvBuySellOrder
     * @return
     */
    Map<String, Object> summaryZfb(PvBuySellOrder pvBuySellOrder);

    /**
     * 合计银联支付合计
     * @param pvBuySellOrder
     * @return
     */
    Map<String, Object> summaryUnionPay(PvBuySellOrder pvBuySellOrder);

    Map<String, Object> sumWalletLog(PvBuySellOrder pvBuySellOrder);



}
